home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 12 / CU Amiga Magazine's Super CD-ROM 12 (1997)(EMAP Images)(GB)[!][issue 1997-07].iso / CUCD / Games / DestructivePoker / sources / sources.lha / IntLabel.h < prev    next >
C/C++ Source or Header  |  1997-02-18  |  963b  |  44 lines

  1. /*
  2.         IntLabel.h
  3.  
  4.         V1.00 - 121296  Kimmo Teräväinen
  5.         -----   ------  ----------------
  6.         V0.01   121296  Started
  7.         V0.05   131296  Update() done & moved to IntLabel.cpp
  8.         V0.10   260197  Tested & Ready.
  9.  
  10. */
  11. #ifndef DC1_INTLABEL
  12. #define DC1_INTLABEL
  13.  
  14. #include "radiogroup.h"
  15.  
  16. class TIntLabel : public cPanel {
  17.   int val;
  18.   Window *wnd;
  19. public:
  20.   TIntLabel(Window *Wnd,int value,int a,int b,int c,int d,int r=PNL_LOWERED) :
  21.     val(value),
  22.     cPanel(a,b,c,d,r),
  23.     wnd(Wnd)
  24.   {
  25.     Update(wnd->RPort);
  26.   }
  27.  
  28.   operator int() const { return val; }
  29.  
  30.   int operator=(int value) { val=value; Update(wnd->RPort); return val; }
  31.   TIntLabel &operator=(const TIntLabel &value) {
  32.     val=value.val;
  33.     Update(wnd->RPort);
  34.     return *this;
  35.   }
  36.  
  37.   int operator+=(int value) { val+=value; Update(wnd->RPort); return val; }
  38.   int operator-=(int value) { val-=value; Update(wnd->RPort); return val; }
  39.  
  40.   void Update(RastPort *);
  41. };
  42.  
  43. #endif
  44.